- avatar_side = message_or_action[:sender].id == @current_user.id ? "left" : "right"

.row.message-row
  .col-12.message-container
    - if message_or_action[:admin]
      - avatar = @current_community.logo.present? ? @current_community.logo.url(:header_icon_highres) : missing_avatar(:thumb)
    - else
      - avatar = message_or_action[:sender].image.present? ? message_or_action[:sender].image.url(:thumb) : missing_avatar(:thumb)
    %div{class: "message-avatar-#{avatar_side}"}
      = image_tag(avatar, :class => "message-avatar-image")
    %div{class: "message-content-container-#{avatar_side}"}
      %div{class: "message-time-ago-#{avatar_side}"}
        - if message_or_action[:admin]
          %b= @current_community.name(I18n.locale)
        - else
          = link_to_unless message_or_action[:sender].deleted, PersonViewUtils.person_display_name(message_or_action[:sender], @current_community), person_path(username: message_or_action[:sender].username)
        = time_ago(message_or_action[:created_at])

      %div{class: "message-bubble-arrow-to-#{avatar_side} message-type-#{message_or_action[:type]} message-mood-#{message_or_action[:mood]}"}
        %div
          - text_with_line_breaks do
            = message_or_action[:content]
